package com.demo.inp;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class KuaInterceptor implements Interceptor {
    @Override
    public void intercept(Invocation inv) {
        inv.getController().getResponse().addHeader("Access-Control-Allow-Origin", "*");
        inv.getController().getResponse().setHeader("Access-Control-Allow-Headers", "Content-Length,X-Requested-With,content-type");
        inv.getController().getResponse().setHeader("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");

        inv.invoke();
    }
}
